# -*- coding: utf-8 -*-
# @Time:  2025/7/20 17:33
# @File:  database.py
# @Action:
from sqlmodel import SQLModel, create_engine

# SQLite数据库连接
SQLITE_URL = "sqlite:///./test.db"

engine = create_engine(
    SQLITE_URL,
    connect_args={"check_same_thread": False},  # 仅SQLite需要
    echo=True  # 打印SQL语句
)

def init_db():
    """创建所有表"""
    SQLModel.metadata.create_all(engine)